package com.jiangxjsy.admin.client;

import com.jiangxjsy.core.wrap.Result;
import com.jiangxjsy.core.wrap.ResultBuilder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.ArrayList;
import java.util.List;

/**
 * wukong-crm-master
 * 蒋胜宇
 * 2025/6/8 19:00
 */

@FeignClient(name = "crm", fallback = CrmClient.CrmClientFallback.class)
public interface CrmClient {
    /**
     * 查询客户池名称列表
     *
     * @return 客户池名称列表
     */
    @PostMapping("/crmCustomerPool/queryPoolNameListByAuth")
    Result<List<?>> queryPoolNameListByAuth();


    @Component
    class CrmClientFallback implements CrmClient {
        /**
         * 查询客户池名称列表
         *
         * @return 客户池名称列表
         */
        @Override
        public Result<List<?>> queryPoolNameListByAuth() {
            return ResultBuilder.ok(new ArrayList<>());
        }
    }
}
